home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Libraries / TurboTCP 2.0.1 / TurboTCP source / UTurboTCP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-03  |  1.3 KB  |  61 lines  |  [TEXT/MPCC]

  1. /*
  2. ** UTurboTCP.h
  3. **
  4. **    TurboTCP support library
  5. **    Utility functions
  6. **
  7. **    Copyright © 1993-94, FrostByte Design / Eric Scouten
  8. */
  9.  
  10.  
  11. #pragma once
  12.  
  13.  
  14. // miscellaneous public constants
  15.  
  16. #define minReceiveSize        4096L        // minimum TCP receive buffer
  17. #define recReceiveSize        16384L        // recommended TCP buffer size
  18. #define recAutoRecNum        4            // recommended # of auto-receive calls (set higher for high performance)
  19. #define recAutoRecSize        4            // recommended size of RDS for auto-receive (set higher for high performance)
  20.  
  21.  
  22. // custom OSErr codes: start from +23000 since MacTCP starts with -23000
  23.  
  24. enum {
  25.     noTCPError = 23000,                // MacTCP is not installed
  26.     noResolverErr = 23002,                // MacTCP’s DNR is not available
  27.     resolverInUse = 23003,                // resolver call object was already being used
  28.     resolverBusy = 23004                // MacTCP’s DNR was busy
  29. };
  30.  
  31.  
  32. /*______________________________________________________________________
  33. **
  34. ** UTurboTCP
  35. **
  36. **    Utility class. Created to reduce namespace pollution.
  37. **
  38. */
  39.  
  40. class UTurboTCP {
  41.  
  42. public:
  43.  
  44.     // opening/closing TCP services
  45.  
  46.     static void        InitTCP();
  47.     static void        CloseTCP();
  48.  
  49.  
  50.     // processing network events
  51.  
  52.     static void        ProcessNetEvents(short maxEventsToProcess, long maxTicks);
  53.  
  54.     
  55.     // IP address utilities
  56.  
  57.     static unsigned long    GetLocalIPAddr();
  58.     static void        DoAddrToStr(unsigned long theIPaddr, char* theString);
  59.  
  60. };
  61.